package com.devunion.bogdan.view.project.actions;

import org.apache.log4j.Logger;

import javax.swing.*;
import java.awt.event.ActionEvent;

import com.devunion.bogdan.model.project.ProjectManager;
import com.devunion.bogdan.model.project.ProjectSavingException;
import com.devunion.bogdan.util.IconHelper;
import com.devunion.bogdan.view.project.dialogs.ManageProjectsDialog;
import com.devunion.bogdan.view.util.DialogHelper;

class ManageProjectsAction extends AbstractAction {
    private static Logger log = Logger.getLogger(ManageProjectsAction.class);
    private JDialog jDialogManageProjects;

    public ManageProjectsAction() {
        super(null, IconHelper.getIcon("ManageProjects16.gif"));
        putValue(Action.LARGE_ICON_KEY, IconHelper.getIcon("ManageProjects48.gif"));

    }

    public void actionPerformed(ActionEvent e) {
        if (jDialogManageProjects == null) {
            jDialogManageProjects = new ManageProjectsDialog(DialogHelper.getMainFrame());
        }

        jDialogManageProjects.setVisible(true);
    }
}
